package com.neutech.controller;

import com.neutech.service.DepartmentService;
import com.neutech.service.VisitListService;
import com.neutech.service.SchedulService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@CrossOrigin
@RestController
public class VisitListController {
//    @Autowired
//    private MenuService menuService;
    /*******************医生___START*************************/
    @Autowired
    private VisitListService visitListService;
    @RequestMapping("/queryVisitList")
    public List<Map<String,Object>> getVisitList(){
        return visitListService.queryVisitList();
    }
    @RequestMapping("/insertVisitList")
    public void insVisitList(@RequestParam Map  map){
        visitListService.insertVisitList(map);
        System.out.println(map.get("patid"));
    }
    @RequestMapping("/deleteVisitList")
    public void delVisitList(@RequestParam Map  map){
        visitListService.deleteVisitList(map);
        System.out.println(map.get("patid"));
    }
    @RequestMapping("/updataVisitList")
    public void updVisitList(@RequestParam Map  map){
//        System.out.println("看这里");
//        System.out.println(map);
//        System.out.println("看这里");
        Map<String,Object> map2 = new HashMap<>();
        map2.put("docid",map.get("patid"));
        map2.put("name",map.get("docid"));
        map2.put("depid",map.get("date"));
        visitListService.updataVisitList(map2);
    }
    /**************************END*******************************/

}
